import http from "@/api";

export interface ResFileUrl {
  fileUrl: string;
}

/**
 * @name 文件上传模块
 */
// * 图片上传
export const uploadImg = (params: FormData) => {
  return http.post<ResFileUrl>(`/comm/comapi/upload`, params);
};

// * 图片上传
export const uploadVideo = (params: FormData) => {
  return http.post<ResFileUrl>(`/comm/comapi/upload`, params);
};

// * 图片上传-轮播图
export const uploadShare = (params: FormData) => {
  return http.post<ResFileUrl>(`/comm/comapi/uploadmpshare`, params);
};

// * 图片上传-轮播图
export const uploadCal = (params: FormData) => {
  return http.post<ResFileUrl>(`/comm/comapi/uploadcal`, params);
};

// * 图片上传-企业营业执照 和其它证件
export const uploadCpyImg = (params: FormData) => {
  return http.post<ResFileUrl>(`/comm/comapi/uploadcpyid`, params);
};

// * 图片上传-企业营业执照 和其它证件
export const uploadUserId = (params: FormData) => {
  return http.post<ResFileUrl>(`/comm/comapi/uploaduserid`, params);
};

// * 上传招工相关的图片和视频
export const uploadJob = (params: FormData) => {
  return http.post<ResFileUrl>(`/comm/comapi/uploadjob`, params, { timeout: 300000 });
};

// * 上传考证相关的图片
export const uploadTrainImg = (params: FormData) => {
  return http.post<ResFileUrl>(`/comm/comapi/uploadtrain`, params, { timeout: 300000 });
};

// * 图片上传-企业资源，视频和图片
export const uploadCpyRes = (params: FormData) => {
  return http.post<ResFileUrl>(`/comm/comapi/uploadcpyres`, params, { timeout: 300000 });
};
